<?php
session_start();
ini_set('display_errors', 1); 
ini_set('error_reporting', 'E_error'); 
ob_start();
$sessid=session_id();
//echo $_SESSION['user_type_sess'];
//echo $_SESSION['user_id_sess'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php require_once "includes/config.php";require_once "includes/functions.php";if(isset($_GET["policy"])) echo "Swapen.com - Privacy Policy";else if(isset($_GET["terms"])) echo "Swapen.com - Terms and Conditions";else echo "Swapen - Make it happen, buy it, sell it, earn it";?></title>
<script src="js/spry/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="js/spry/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<link href="includes/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/functions.js"></script>
</head>
<body>
<?php 
	$user = checkSession();
	$userId= $user['id'];
	$userName= $user['name'];
	$userType= $user['type'];
	//echo $_SESSION['user_type_sess'];
?>
<table width="950" border="0" align="center" bgcolor="#FFFFFF">
  <tr>
    <td height="119"><?php include_once "header1.php";?></td>
  </tr>
 <!--  <tr>
    <td>
      <table width="100%"  border="0" align="center">
        <tr>
          <td width="60%">&nbsp;</td>
          <td width="40%" align="right">>><?php include("search_panel.php"); ?></td>
        </tr>
      </table></td>
  </tr> -->
 
  <tr>
    <td height="193"  class="container" style="width:100%;">
		
				<div style="width:950px; float:left; vertical-align:top;">
					<div style="float:left">
							<?php
						
								//if(!isset($_GET['signup']) && !isset($_GET['registerChoicePage']) && !isset($_GET['registerChoicePage_merchant']) && !isset($_GET['registerChoicePage_wholeseller']) )
								if(!isset($_SESSION['user_id_sess']) && !isset($_GET['signup']) && !isset($_GET['registerChoicePage']) && !isset($_GET['registerChoicePage_merchant']) && !isset($_GET['registerChoicePage_wholeseller']) )
								include_once "top_panel.php";
								
								//if(!isset($_GET['signup']))
								//include_once "left_panel.php";
							?>
					</div>
				</div>
				
				
				<div style="width:950px; float:left; vertical-align:top;"> 
					  <?php
					   
					   if(isset($_GET['refer'])) {
					   include_once "refer.php";
							
					  }
					  
					  
					  
					  if(isset($_GET['sell'])) {
					   include_once "sell_product.php";
							
					  }
					  else if(isset($_GET['amazon_email'])) {
						 require_once "amazon_email.php";				 	
					  }
					  else if(isset($_GET['amazon_land'])) {
						 require_once "amazon_land.php";				 	
					  }
					  else if(isset($_GET['amazon_payment'])) {
						 require_once "amazon_payment.php";				 	
					  }
					  
					  //else if(isset($_GET['tran_history'])) {
		//			  	 require_once "tran_history.php";				 	
		//			  }
					  else if(isset($_GET['inbox'])) {
						if($_SESSION['user_type_sess']=='1')
						{
						/*echo "<p align='right'>
							<input type='button' value='Seller' onclick='window.location=\"index.php?switchto\"'>
							<input type='button' value='Buyer' onclick='window.location=\"index.php?mySwapen\"'>
						</p>";	*/
						$url1="index.php?mySwapen";
						$url="index.php?switchto";
					} else if($_SESSION['user_type_sess']=='2') {
						/*echo "<p align='right'>
							<input type='button' value='Seller' onclick='window.location=\"index.php?mySwapen\"'>
							<input type='button' value='Buyer' onclick='window.location=\"index.php?switchto\"'>
						</p>";*/
						$url="index.php?mySwapen";
						$url1="index.php?switchto";
					} else if($_SESSION['user_type_sess']=='4') {
						/*echo "<p align='right'>
							<input type='button' value='Seller' onclick='window.location=\"index.php?mySwapen\"'>
							<input type='button' value='Buyer' onclick='window.location=\"index.php?mySwapen&buyer\"'>
						</p>";*/
						$url="index.php?mySwapen";
						$url1="index.php?mySwapen&buyer";
					}
					else if($_SESSION['user_type_sess']=='5') {
						/*echo "<p align='right'>
							<input type='button' value='Seller' onclick='window.location=\"index.php?mySwapen\"'>
							<input type='button' value='Buyer' onclick='window.location=\"index.php?mySwapen&buyer\"'>
						</p>";*/
						$url="index.php?mySwapen";
						$url1="index.php?mySwapen&buyer";
					}
						 require_once "inbox.php";				 	
					  }
					  else if(isset($_GET['resolution'])) {
						 require_once "resolution.php";				 	
					  }
					   else if(isset($_GET['read'])) {
						 require_once "read.php";				 	
					  }
					  else if(isset($_GET['reply'])) {
						 require_once "reply.php";				 	
					  }
					  else if(isset($_GET['post'])) {
						 require_once "post.php";				 	
					  }
					  else if(isset($_GET['profile'])) {
						 require_once "edit_profile.php";
							
					  }
					  else if(isset($_GET['update_login_details'])) {
						 require_once "edit_profile_login_details.php";
							
					  }
					  else if(isset($_GET['communications'])) {
						 require_once "communications_details.php";
							
					  }
					  else if(isset($_GET['token_id'])) {
						 require_once "token_id.php";				 	
					  }
					  else if(isset($_GET['comm_token_id'])) {
						 require_once "comm_token_id.php";				 	
					  }
					  else if(isset($_GET['viewpro'])) {
						 require_once "view_profile.php";
							
					  }
					  else if(isset($_GET['addProduct'])) {
						 require_once "product_to_sell.php";
						  
					  }
					  else if(isset($_GET['srch'])) {
						 require_once "search_result.php";
						 
					  }
					  else if(isset($_REQUEST['srchwhole'])) {
					 
						 require_once "search_whole_result.php";
						 
					  }
					   else if(isset($_GET['srchBuyer'])) {
					   if($_GET['sg']=="merchant") {
						 require_once "search_merchant.php";
						 }
						 else
						 {
						  require_once "search_buyer.php";
						 }
						
						 
					  }
					  
					  // codex technology Start here
					  else if(isset($_GET['postsearch'])) {
						 require_once "index.php";
					  }
					  else if(isset($_GET['srchPost'])) {
						 require_once "search_post.php";
						 
					  }
					  else if(isset($_GET['showPost'])) {
						 require_once "show_post.php";
						 
					  }
					  else if(isset($_GET['uploadFile'])) {
						 require_once "uploadFile.php";
						 
					  }
					  else if(isset($_GET['spid'])) {
						 require_once "allseller_items.php";
						 
					  }
					   else if(isset($_GET['wholeproducts'])) {
							if(!empty($_GET['wholeproducts'])) {
								require_once "view_whole_product.php";
								 
							} 
					   }
					  // Codex technology End Here
					  else if(isset($_GET['products'])) {
						if(!empty($_GET['products'])) {
							require_once "view_product.php";
							 
						}
						else {
							require_once "list_products.php"; 
							
						}	
					   }
					   else if(isset($_GET['products_old'])) {
						require_once "view_product_old.php";
					   }
					   else if(!empty($_GET['cat'])) {
							require_once "list_products.php";
							
					   }
					   else if(!empty($_GET['postcat'])) {
							require_once "list_post.php";
							
					   }
					   else if(!empty($_GET['subCat'])) {
							require_once "show_subcategories.php";
							
					   }
					   else if(isset($_GET['mylist'])) {
							require_once "my_listings.php";
							
					   }
					   else if(isset($_GET['editlist'])) {
							if(!empty($_GET['editlist'])) {
								require_once "edit_list.php";
								
							}
					   }
						else if(isset($_GET['whole_listing'])) {
							if(!empty($_GET['whole_listing'])) {
								require_once "whole_listings.php";
								
							}
					   }
						else if(isset($_GET['editwholeitem'])) {
							if(!empty($_GET['editwholeitem'])) {
								require_once "edit_wholesaleitem.php";
								
							}
					   }
					   else if(isset($_GET['wlist'])) {
							require_once "wishlist.php";
							 
					   }
					   else if(!empty($_GET['wishproduct'])) {
							require_once "wishlist_product.php";					
					   }
						else if(!empty($_GET['wwishproduct'])) {
							require_once "wwishlist_product.php";					
					   }
						else if(!empty($_GET['editjob'])) {
							require_once "editjob.php";					
					   }
					   else if(isset($_GET['signout'])) {
							signout();
							if(!isset($_REQUEST['redi']))
							{
							    $_SESSION['viewcart']="";
							    echo "<script type='text/javascript'> window.location='index.php'; </script>";
							}
							else
							{
							   echo "<script type='text/javascript'> window.location='index.php?signin'; </script>";
							   $_SESSION['viewcart']=1;
							}
					   }			   
					   else if(isset($_GET['signin'])) {
							require_once "signin.php";
							
					   }
					  else if(isset($_GET['search'])) {
						 require_once "search_panel.php";
						  
					  }
					  else if(isset($_GET['confirm'])) {
						require_once "confirm.php";
						
					  }
					  else if(isset($_GET['feedback'])) {
						require_once "show_feedback.php";
						
					  }	
					  else if(isset($_GET['SellProduct'])) {
						 require_once "product_to_view.php";
						  
					  }
					  else if(isset($_GET['Postfeedback'])) {
						 require_once "post_feedback.php";
						  
					  }
					  else if(isset($_GET['editSellingProduct'])) {
						 require_once "product_selling_edit.php";
						  
					  }
					  else if(isset($_GET['viewItems'])) {
						 require_once "view_items.php";
						  
					  }
					  else if(isset($_GET['confirmRegister'])) {
						require_once "confirm_register.php";
						
					  }
					  else if(isset($_GET['forgotPassword'])) {
						require_once "forgot_password.php";
						
					  }
					  else if(isset($_GET['forgotPasswordConfirm'])) {
						require_once "forgot_password_confirm.php";
						
					  }
					   else if(isset($_GET['passwordChange'])) {
						require_once "reset_password.php";
						
					  }
					   else if(isset($_GET['forgotUsername'])) {
						require_once "forgot_username.php";
						
					  }
					  else if(isset($_GET['forgotUsernameConfirm'])) {
						require_once "forgot_username_confirm.php";
						
					  }
					   else if(isset($_GET['usernameChange'])) {
						require_once "reset_username.php";
						
					  }
					  else if(isset($_GET['signup'])) {
					   require_once "signup.php";
					   
					  } 
					  
					  else if(isset($_GET['registerChoicePage'])){
						require_once "registerChoicePage.php";
					  }
					  else if(isset($_GET['registerChoicePage_merchant'])){
						require_once "registerChoicePage_merchant.php";
					  }
					  else if(isset($_GET['registerChoicePage_wholeseller'])){
						require_once "registerChoicePage_wholeseller.php";
					  }
					  
					  else if(isset($_GET['policy'])) {
						include_once "privacy_policy.php";
						
					  } 
					  else if(isset($_GET['terms'])) {
						include_once "terms.php";
						
					  } 
					  else if(isset($_GET['contact'])) {
						include_once "contact.php";
						
					  } 
					  else if(isset($_GET['registerMember'])) {
						include_once "register_member.php";
						
					  } 
					  else if(isset($_GET['registerMerchant'])) {
					   include_once "register_merchant.php";
					   
					   }
					   // Codex Technology 3-5-10
					   else if(isset($_GET['registerWholeseller'])) {
					   include_once "register_wholeseller.php";
					   
					   }
					   else if(isset($_GET['import']))
					   {
					   if($_GET['import']==1)
					   {
						include_once "wholeseller_import.php";
						}
					   
					   }
					   // end
					  else if(isset($_GET['notFound'])) {
					   include_once "not_found.php";
					  }
					  else if(isset($_GET['faq'])) {
					   include_once "support/faq.php";
					  }
					  else if(isset($_GET['agreement'])) {
							include_once "support/agreements.php";
					  }
					   else if(isset($_GET['about'])) {
							include_once "about_swapen.php";
					  }
					  else if(isset($_GET['about'])) {
							include_once "about_swapen.php";
					  }
					  
					  else if(isset($_GET['switchto'])) {
							include_once "change_user_type.php";
					  }
					  
					  else if(isset($_GET['store'])) {
							include_once "add_seller_store.php";
					  }
					  
					  else if(!empty($_GET['updstore'])) {
						include_once "edit_seller_store.php";
					  }
					  else if(isset($_GET['cart'])) {
					  
					   include_once "cart.php";
							
					  }
					  else if(isset($_GET['checkout'])) {
					  
					   include_once "checkout.php";
							
					  }
					   else if(isset($_GET['order'])) {
					  
					   include_once "order.php";
							
					  }
					  else if(isset($_GET['cancelled'])) {
					  
					   include_once "cancelled.php";
							
					  }
					  else if(isset($_GET['sell_page'])) {
						require_once "sell.php";
					  }
					  else if(isset($_GET['process'])) {
					  
					   include_once "cancelled.php";
							
					  }
					  else {
						if(isset($_GET['mySwapen'])) {
								
								if($_SESSION['user_type_sess']=='1') {
									/*echo "<p align='right'>
										<input type='button' value='Seller' onclick='window.location=\"index.php?switchto\"'>
										<input type='button' value='Buyer' onclick='window.location=\"index.php?mySwapen\"'>
									</p>";	*/
									$url1="index.php?mySwapen";
									$url="index.php?switchto";
								} else if($_SESSION['user_type_sess']=='2') {
									/*echo "<p align='right'>
										<input type='button' value='Seller' onclick='window.location=\"index.php?mySwapen\"'>
										<input type='button' value='Buyer' onclick='window.location=\"index.php?switchto\"'>
									</p>";*/
									$url="index.php?mySwapen";
									$url1="index.php?switchto";
								} else if($_SESSION['user_type_sess']=='4') {
									/*echo "<p align='right'>
										<input type='button' value='Seller' onclick='window.location=\"index.php?mySwapen\"'>
										<input type='button' value='Buyer' onclick='window.location=\"index.php?mySwapen&buyer\"'>
									</p>";*/
									$url="index.php?mySwapen";
									$url1="index.php?mySwapen&buyer";
								}
								else if($_SESSION['user_type_sess']=='5') {
									/*echo "<p align='right'>
										<input type='button' value='Seller' onclick='window.location=\"index.php?mySwapen\"'>
										<input type='button' value='Buyer' onclick='window.location=\"index.php?mySwapen&buyer\"'>
									</p>";*/
									$url="index.php?mySwapen";
									$url1="index.php?mySwapen&buyer";
								}
								?><div class='mypg_left_out'><?
									include("mypg_left.php");
								?></div>
								<div class='fullbox_out'>
									<a name="mswapen" id="mswapen"></a>
									<?php
												
								if($_SESSION['user_type_sess']=='1') {
									include("my_swapen_seller.php");
									include("panel_wishlist.php");
									include("myswapen_refcomm.php");
									 include("feedback_pending_merc.php");
									require_once "tran_history.php";
									
									//include("listing_buyer.php");
									include("post_listing.php");		
									include("panel_product.php");
									
									//include("panel_product.php");
								}
								else if($_SESSION['user_type_sess']=='2') {
								include("my_swapen_seller.php");
								 include("listing_seller.php");
								 include("myswapen_refcomm.php");
								 include("comm_pay.php");
								 include("feedback_pending_merc.php");
								include("post_listing.php");		
								
								 
								 require_once "tran_history.php";
								 include("panel_product.php");
								 
								}
								else if($_SESSION['user_type_sess']=='3') {
									 include("my_swapen_merchant.php");
									 include("listing_merchant.php");
									 include("comm_pay.php");
									 include("post_listing.php");
									 include("myswapen_refcomm.php");
									 require_once "tran_history.php";
									 include("feedback_pending_merc.php");
								         //include("panel_message.php");										 	 		
									 include("panel_mwishlist.php");
									 include("panel_product.php");
								}
								else if($_SESSION['user_type_sess']=='4') {
									if(isset($_GET['buyer'])) {
										include("my_swapen_seller.php");
										include("panel_wishlist.php");
										include("myswapen_refcomm.php");
										include("feedback_pending_merc.php");
										require_once "tran_history.php";
										
										//include("listing_buyer.php");
										include("post_listing.php");		
										include("panel_product.php");
																				
									} else {
										include("my_swapen_seller.php");
										include("listing_seller.php");
										include("myswapen_refcomm.php");
										include("comm_pay.php");
										include("feedback_pending_merc.php");
										include("post_listing.php");		
									
										require_once "tran_history.php";
										include("panel_product.php");
									}
								}
								else if($_SESSION['user_type_sess']=='5') {
									if(isset($_GET['buyer'])) {
										 include("feedback_pending_merc.php");
										include("post_listing.php");		
										include("panel_wishlist.php");
										include("panel_product.php");
									} else {
										include("my_swapen_wholesaler.php");
										include("listing_seller.php");
										include("post_listing.php");	
										 include("feedback_pending_merc.php");
										//include("panel_message.php");
										require_once "tran_history.php";	
										
										//include("comm_pay.php");
										
										//include("panel_product.php");
								}
								}
								?>
								</div> <?php 
						}
						else {
							//include_once "front.php";
							include_once "front2_page.php";
						}
					  }
					  ?>
					  
					  <br>           	 
				</div>
			
	</td>
  </tr>
  <tr>
	  	<td><?php if(empty($_GET)) {  require_once 'product_strip.php'; } ?></td>
  </tr>
  <tr>
    <td height="80"><?php include_once "footer.php";?></td>
  </tr>
</table>
</body>
</html>
<?php
//session_destroy();
?>
